
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>每日采购材料统计</title>
  <#assign base=request.contextPath  />
  <base id="basePath" href="${base}">

  	<base id="basePath" href="${base}">
  	<link rel="stylesheet" href="${base}/css/demo.css" type="text/css">
  	<link rel="stylesheet" href="${base}/css/zTreeStyle.css" type="text/css">
  	<script type="text/javascript" src="${base}/js/ztree/jquery-1.4.4.min.js"></script>
  	<script type="text/javascript" src="${base}/js/ztree/jquery.ztree.core.js"></script>
  	<script type="text/javascript" src="${base}/js/zhang.js"></script>
  	<script type="text/javascript" src="${base}/js/ztree/jquery.ztree.excheck.js"></script>
  	<script type="text/javascript" src="${base}/js/ztree/jquery.ztree.exedit.js"></script>


  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="${base}/js/layui/css/layui.css"  media="all">
 <style type="text/css">
   form{
           padding: 20px;
             }
      .layui-btn-radius{
           border-radius: 5px;
          }
  </style>
</head>
<body>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  <legend>每日采购材料统计</legend>
</fieldset> 
		<div class="layui-tab">
		  <ul class="layui-tab-title">
		    <li class="layui-this">办公用品</li>
		    <li>厨房食材</li>
		    <li>日常用品</li>
		  </ul>	 	
		  <div class="layui-tab-content">
		    <div class="layui-tab-item layui-show">
		     <button class="layui-btn layui-btn-radius" onclick="javascript:insertHome()"  data-method="offset" type="button" style="background-color: #0092EF;">添加办公用品</button>
		    	<table class="layui-table" lay-filter="test3" lay-data="{url:'${base}/purchasing/select',id:'test1' ,height:500,page: {
                            layout: ['limit', 'count', 'prev', 'page', 'next', 'skip']
                             ,theme: '#0092EF'
                               ,limit:20
                               },where:{type:'1'}}">
		     <thead>
			    <tr>
                  <th lay-data="{field:'id', templet:function(val){return val.LAY_INDEX},edit: 'text',width:60}">序号</th>
			      <th lay-data="{field:'createTime',templet:function(val){return changeDateFormat(val.createTime)}}">时间</th>
			      <th lay-data="{field:'persion', edit: 'text'}">购买人</th>
			      <th lay-data="{field:'office', edit: 'text'}">办公用品</th>
			      <th lay-data="{field:'price', edit: 'text'}">金额</th>
			    </tr>		    
			  </thead>
			</table>
		    </div>
		    <div class="layui-tab-item">
		    <button class="layui-btn layui-btn-radius" onclick="javascript:toHomeifream()" data-method="offset" type="button" style="background-color: #0092EF;">添加厨房食材</button>
		    	<table class="layui-table" lay-filter="test3" lay-data="{url:'${base}/purchasing/select',id:'test2',page: {
                                                              layout: ['limit', 'count', 'prev', 'page', 'next', 'skip']
                                                              ,theme: '#0092EF'
                                                              ,limit:20
                                                              },where:{type:'2'}}">
		     <thead>
			    <tr>
                  <th lay-data="{field:'id', templet:function(val){return val.LAY_INDEX}, edit: 'text',width:60}">序号</th>
			      <th lay-data="{field:'createTime', templet:function(val){return changeDateFormat(val.createTime)}}">时间</th>
			       <th lay-data="{field:'persion', edit: 'text'}">购买人</th>
			       <th lay-data="{field:'kitchen', edit: 'text'}">厨房食材</th>
			       <th lay-data="{field:'price', edit: 'text'}">金额</th>
			    </tr>	    
			  </thead>
			</table>
		    </div>
		    <div class="layui-tab-item">
		    <button class="layui-btn layui-btn-radius" onclick="javascript:Homeifream()"  data-method="offset" type="button" style="background-color: #0092EF;">添加日常用品</button>
		    <table class="layui-table" lay-data="{url:'${base}/purchasing/select',id:'test3',toolbar: '#toolbarDemo',defaultToolbar: ['filter', 'print', 'exports'] ,page: {
                                                                            layout: ['limit', 'count', 'prev', 'page', 'next', 'skip']
                                                                            ,theme: '#0092EF'
                                                                            ,limit:20
                                                                            },where:{type:'3'}}" lay-filter="test3">
              <thead>
                <tr>
                  <th lay-data="{field:'id',templet:function(val){return val.LAY_INDEX},width:60}">序号</th>
                  <th lay-data="{field:'createTime',templet:function(val){return changeDateFormat(val.createTime)}}">时间</th>
                  <th lay-data="{field:'persion', edit: 'text', minWidth: 100}">购买人</th>
                  <th lay-data="{field:'supplies', edit: 'text'}">日常用品</th>
                  <th lay-data="{field:'price',edit: 'text', minWidth: 100}">金额</th>
                </tr>
              </thead>
            </table>
		    </div>
		  </div>
		</div>
<script src="${base}/js/layui/layui.js" charset="utf-8"></script>
<script src="${base}/js/jquery.min.js"></script>
<script>
layui.use(['layer','element','form', 'layedit', 'laydate','table'], function(){
  var form = layui.form
  ,$ = layui.jquery
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate
  ,table = layui.table
   ,layer = layui.layer
,element = layui.element;
	  table.on('edit(test3)', function(obj){
          var value = obj.value //得到修改后的值
          ,data = obj.data //得到所在行所有键值
          ,field = obj.field; //得到字段
          layer.msg('[ID: '+ data.id +'] ' + field + ' 字段更改为：'+ value);
        });
	  //触发事件
	  var active = {
	    tabChange: function(){
	      //切换到指定Tab项
	      element.tabChange('demo', '22');
	    }
	  }
	});
 function toHomeifream(){
               layer.open({
                   type: 2
                   ,title: '信息'
                   ,offset: 't'
                   ,area:['422px','100%']
                   ,shade: 0
                   ,offset: 'auto'
                   ,content: ['${base}/variety/arrday2_Add','no']
                   ,zIndex: layer.zIndex
               });
      	 }
      	  function Homeifream(){
                        layer.open({
                            type: 2
                            ,title: '信息'
                            ,offset: 't'
                            ,area:['422px','100%']
                            ,shade: 0
                            ,offset: 'auto'
                            ,content: ['${base}/variety/arrday1_Add','no']
                            ,zIndex: layer.zIndex
                        });
               	 }
      	 function insertHome(){
               layer.open({
                   type: 2
                   ,title: '信息'
                   ,area: ['422px', '322px']
                   ,shade: 0
                   ,offset: 'auto'
                   ,content: ['${base}/variety/arrday3_Add','no']
                   ,zIndex: layer.zIndex

               });
      	 }
</script>
</body>
</html>
